<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Details_products extends CI_Controller {

function index()
	{	
		$this->lang->load('details_products', $this->config->item('language'));
			     
	    // on charge la view qui contient le corps de la page
	    $data['title'] = 'Name products';
	    $data['content'] = 'details_products';
	 
	    // on charge la page dans le template
	    $this->load->view('template/head', $data);
	    $this->load->view('template/template', $data);
	    $this->load->view('template/footer', $data);
	}


function produits()
	{
			
			
			if ($this->uri->segment(3)) 
			{
			$this->lang->load('details_products', $this->config->item('language'));	
			$this->load->model('admin_model');

			$data['rows'] = $this->admin_model->get_produits($this->uri->segment(3));
			// variable transmis à la vue
			$data['id'] = $data['rows']->id_produits;
			$data['title'] = $data['rows']->title_fr;
			$data['description'] = $data['rows']->description_fr;
			$data['photos'] = $data['rows']->photos;

			$data['title'] = $data['rows']->title_fr;

			$data['content'] = 'details_products';
				 

			} 
			else 
			{
				redirect('product');
			}
			
			   // on charge la page dans le template
		    $this->load->view('template/head', $data);
		    $this->load->view('details_products', $data);
		    $this->load->view('template/footer', $data);
			
		}



function products()
	{
			
			
			if ($this->uri->segment(3)) 
			{
			$this->lang->load('details_products', $this->config->item('language'));	
			$this->load->model('admin_model');

			$data['rows'] = $this->admin_model->get_produits($this->uri->segment(3));
			// variable transmis à la vue
			$data['id'] = $data['rows']->id_produits;
			$data['title'] = $data['rows']->title_en;
			$data['description'] = $data['rows']->description_en;
			$data['photos'] = $data['rows']->photos;

			$data['title'] = $data['rows']->title_en;

			$data['content'] = 'details_products';
				 

			} 
			else 
			{
				redirect('product');
			}
			
			   // on charge la page dans le template
		    $this->load->view('template/head', $data);
		    $this->load->view('details_products', $data);
		    $this->load->view('template/footer', $data);
			
		}

}



	
/* End of file home.php */
/* Location: ./application/controllers/welcome.php */